package com.varian.system.mapper;

import com.varian.system.dto.UserNoticeListDTO;
import com.varian.system.vo.UserNoticeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author ben
 * @since 2024/9/3
 */
@Mapper
public interface UserNoticeMapper {
    Integer insertBatch(@Param("noticeId") Long noticeId, @Param("userIds") List<Long> userIds);

    Integer deleteByNoticeId(@Param("noticeId") Long noticeId);

    Integer updateReadStatusByUserId(@Param("userId") Long userId, @Param("readTime") LocalDateTime readTime);

    Integer updateReadStatusByNoticeId(@Param("noticeId") Long noticeId, @Param("readTime") LocalDateTime readTime);

    List<UserNoticeVO> selectListBy(@Param("dto") UserNoticeListDTO dto, @Param("userId") Long userId);

    UserNoticeVO selectByNoticeId(@Param("noticeId") Long noticeId, @Param("userId") Long userId);
}
